<?php 

$auth = $_SESSION['auth'];
if (empty($auth)) die('用户未登录！');

if (!empty($_POST)) die;

$lmcy_id = intval($_GET['lmcy_id']);

global $config;
if (!in_array($auth['id'], $config['manager'])) if (1 > dt_count('finance_lmcy', 'WHERE id = '.$lmcy_id.' AND user_id = '.$auth['id'])) die('用户权限不够!');

$lmcy = dt_query_one("SELECT * FROM finance_lmcy WHERE id = $lmcy_id");
if (!$lmcy) {
	put_info('成员不存在！');
	header('Location:?c=finance&a=lmcy_manage');
	die;
}

?>
<?php require_once('finance/inc/nav_sub_im.html') ?>
<div class="container finance-item-add" style="padding-top:15px">
	<div class="row clearfix">
		<div class="col-md-12 column">
			<h3><span class="glyphicon glyphicon-edit"></span> 成员设置</h3>
			<hr class="solid">
			<div class="col-md-12 column">
				<form class="form-horizontal" action="?c=finance&a=do_lmcy_edit" method="post" enctype="multipart/form-data">
					<fieldset>
						<!-- id -->
						<input type="hidden" name="lmcy_id" value="<?php echo $lmcy['id'] ?>"/>
						<!-- select -->
						<div class="form-group">
							<label class="col-md-2 control-label">类型</label>  
							<div class="col-md-7">
								<select name="kind" class="form-control">
									<option value="TZ" <?php if ('TZ' == $lmcy['kind']) echo 'selected="selected"' ?>>投资公司</option>
									<option value="DB" <?php if ('DB' == $lmcy['kind']) echo 'selected="selected"' ?>>担保公司</option>
								</select>
							</div>
						</div>
						<!-- Text input-->
						<div class="form-group">
							<label class="col-md-2 control-label">名称</label>  
							<div class="col-md-7">
								<input name="name" type="text" placeholder="成员名称" class="form-control input-md" required="" value="<?php echo $lmcy['name'] ?>">
							</div>
						</div>
						<!-- Text input-->
						<div class="form-group">
							<label class="col-md-2 control-label">用户 ID</label>  
							<div class="col-md-7">
								<input name="user_id" type="text" placeholder="用户 ID" class="form-control input-md" required="" value="<?php echo $lmcy['user_id'] ?>">
							</div>
						</div>
						<!-- Text input-->
						<div class="form-group">
							<label class="col-md-2 control-label">图标</label>  
							<div class="col-md-4 column">
								<input class="form-control" type="file" id="logo" name="logo" />
								<img width="300px" src="img/finance/lmcy/logo/<?php echo $lmcy_id ?>"/>
							</div>
						</div>
						<!-- Text input-->
						<div class="form-group">
							<label class="col-md-2 control-label">主图</label>  
							<div class="col-md-4 column">
								<input class="form-control" type="file" id="h_img" name="h_img" />
								<img width="625px" src="img/finance/lmcy/h_img/<?php echo $lmcy_id ?>"/>
							</div>
						</div>
						<!-- token -->
						<input type="hidden" name="token" value="<?php echo get_token() ?>"/>

						<!-- Button -->
						<br>
						<div class="form-group">
							<label class="col-md-2 control-label"></label>
							<div class="col-md-2">
								<button class="btn btn-primary btn-block">编辑成员</button>
							</div>
						</div>

					</fieldset>
				</form>	


			</div>
		</div>
	</div>
</div>

<script type="text/javascript">

$(document).ready(function(){
		$('li#finance_im').addClass('active');
		$('li#im_sz').addClass('active');
		});

</script>
